<template>
  <div class="index box">
    <div class="container">
      <div class="content">
        <img
          :src="
            isEn
              ? require('../assets/img/EN/indextitle.png')
              : require('../assets/img/CN/indextitle.png')
          "
          class="title"
        />
        <div class="changebox">
          <div :class="['cn', isEn ? '' : 'active']" @click="isEn = false">
            <span>中文</span>
          </div>
          <div
            :class="['en clmcenter', isEn ? 'active' : '']"
            @click="isEn = true"
          >
            <span>EN</span>
          </div>
        </div>
        <div class="enterbtn" @click="Enter">
          <div class="enter_text clmcenter">
            <span :style="{ 'padding-top': isEn ? '0.5rem' : '' }">{{
              isEn ? "ENTER" : "点击进入"
            }}</span>
          </div>
          <div class="enter_icon clmcenter">
            <van-icon name="play" color="#004d91" size="2rem" />
          </div>
        </div>
      </div>
    </div>
    <img src="../assets/img/index.png" class="foot" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      isEn: false, //当前选择的语言是否是英文
    };
  },
  methods: {
    Enter() {
      this.isEn ? this.$router.replace("/en") : this.$router.replace("/cn");
      // if (!this.isEn) {
      //   this.$router.replace("/cn");
      // } else {
      //   Toast("敬请期待~");
      // }
    },
  },
};
</script>

<style lang="less" scoped>
.index {
  background: linear-gradient(to right, #e9f3ff, #f4f8ff);
  .container {
    position: relative;
    width: 100%;
    z-index: 2;
    display: flex;
    flex-flow: column nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    .content {
      width: 100%;
      margin-left: 2rem;
      .title {
        width: 84.8%;
        margin-top: 3rem;
      }
      .changebox {
        margin: 1.5rem 0;
        display: flex;
        div {
          background: none;
          border: 1px solid #22a0d4;
          box-sizing: border-box;
          border-radius: 1rem;
          text-align: center;
          color: #22a0d4;
          font-size: 1.2rem;
          cursor: pointer;
          span {
            padding: 0.1rem 2rem;
          }
        }
        .cn {
          display: table;
        }
        .en {
          font-family: "Helvetica";
          margin-left: 2rem;
        }
        .active {
          background: #22a0d4;
          color: #fff;
        }
      }
      .enterbtn {
        position: relative;
        width: 344px;
        height: 60px;
        background: #22a0d4;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 1px 2px 5px 1px rgba(2, 75, 148, 0.45);
        cursor: pointer;
        .enter_text {
          width: calc(100% - 4rem);
          height: 100%;
          font-size: 1.8rem;
          color: #fff;
          text-align: center;
        }
        .enter_icon {
          width: 4rem;
          height: 100%;
          background: #fff;
        }
      }
    }
  }
  .foot {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
  }
}
@media only screen and (min-height: 1300px) {
  .index {
    .container {
      .content {
        .title {
          margin-top: 5rem;
        }
        .changebox {
          margin: 2rem 0;
        }
      }
    }
  }
}
@media only screen and (min-height: 1350px) {
}
@media only screen and (min-height: 1400px) {
  .index {
    .container {
      .contetn {
        .changebox {
          margin: 3rem 0;
        }
      }
    }
  }
}
</style>
